home *** CD-ROM | disk | FTP | other *** search
/ Champak 139 / (Vol 139) Sep 24 2011.iso / Games / xtreme_tugboating.swf / scripts / DefineSprite_229 / frame_1 / DoAction.as
Text File  |  2011-09-24  |  830b  |  33 lines

  1. stop();
  2. this._visible = false;
  3. _root.rainbowCombo = 0;
  4. this.onEnterFrame = function()
  5. {
  6.    if(random(100) == 0)
  7.    {
  8.       this._visible = true;
  9.       _rotation = random(360);
  10.       this.play();
  11.       this.onEnterFrame = function()
  12.       {
  13.          if(this.hitTest(_root.player._x,_root.player._y,true))
  14.          {
  15.             if(_root.player.vSpeed > -10)
  16.             {
  17.                _root.player.vSpeed -= 2;
  18.             }
  19.             _root.score = _root.score + 1;
  20.             _root.rainbowCombo += 25;
  21.             if(_root.health < 100)
  22.             {
  23.                _root.health += 0.1;
  24.             }
  25.             if(random(2) == 0)
  26.             {
  27.                _root.makeFlame(_root.player._x + random(20) - 10,_root.player._y + random(20) - 10,0,0);
  28.             }
  29.          }
  30.       };
  31.    }
  32. };
  33.